﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace Assets.Scripts
{
	[RequireComponent(typeof(TrailRenderer))]
	class MyTrail : MonoBehaviour
	{
		private TrailRenderer trailRenderer;

		public float widthFactor = 0.618f;
		public Material material;
		private void Start()
		{
			trailRenderer = GetComponent<TrailRenderer>();
			material = transform.parent.GetComponent<MeshRenderer>().material;
			trailRenderer.material = material;

			trailRenderer.startWidth = transform.parent.localScale.x * widthFactor;
		}
	}
}
